﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using RobotEscape.Screens;

namespace RobotEscape
{
    public partial class MainPage : UserControl
    {
        private Game game;
        public MainPage()
        {
            Application.Current.Host.Settings.MaxFrameRate = 60;

            InitializeComponent();
            game = Game.Instance;
            game.Canvas = this.LayoutRoot;
            game.SwitchScreen(new CompanyLogoScreen(), true);
            //game.SwitchScreen(new StartScreen(), true);
            game.LostFocus();
            KeyState.HookEvents(this);
        }

        private void UserControl_LostFocus(object sender, RoutedEventArgs e)
        {
            game.LostFocus();
        }

        private void UserControl_GotFocus(object sender, RoutedEventArgs e)
        {
            game.GotFocus();
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {

            //System.Windows.Browser.HtmlPage.Plugin.Focus();           
        }
    }
}
